package cn.shop.admin.component.withdraw;

import cn.shop.admin.req.BatchWithdrawReq;
import cn.shop.admin.service.WithdrawService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 提现策略接口
 *
 * @author jzw
 * @since 2021-11-11 10:03
 */
public interface WithdrawStrategy {

	/**
	 * 获取当前提现类型标识
	 *
	 * @return 提现类型标识
	 * @author jzw
	 * @since 2021/11/11 10:36
	 */
	int getType();

	/**
	 * 订单结算
	 *
	 * @param orderIds 订单id
	 * @return
	 * @author jzw
	 * @since 2021/11/11 10:09
	 */
	boolean settlement(BatchWithdrawReq orderIds);

	/**
	 * 批量修改提现订单
	 *
	 * @param service
	 * @param orderIds
	 * @return
	 * @author jzw
	 * @since 2021/12/14 15:43
	 */
	@Transactional(rollbackFor = Exception.class)
	default boolean batchUpdateWithdrawOrderState(WithdrawService service, List<Long> orderIds) {
		return false;
	}

}
